#include <stdio.h>
#define ALPHA 64 // tabela ASCII 

unsigned getbits(unsigned x, int p, int n); // n bitow x od pozycji p

int main()
{
  char* v;
  int i, j, n;
  v = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
  n = 26;
  for(j = 0; j < n; j++) {
    printf("%c\t", v[j]);
    for (i = 4; i >= 0; i--)
      printf("%u", getbits(v[j]-ALPHA, i, 1));
    printf("\n");
  }
  return 0;
}

unsigned getbits(unsigned x, int p, int n)
{
  return (x>>(p+1-n)) & ~(~0<<n);
}
